package main

import (
	"fmt"
	"time"
)

func p() {
	for {
		fmt.Println("test")
	}

}

func main() {
	//go p()

	for i := 0; i < 1000000; i++ {
		// 闭包
		go func(i int) { // 放值进去
			for {
				fmt.Println(i)
				time.Sleep(time.Second)
			}
		}(i)
	}

	// 主死随从
	time.Sleep(time.Second * 30)

	println("imooc")
}
